<cfset sourceImage = ImageRead('#request.basepath#images/temp/#cookie.imagefile#')>

<cfinvoke component="cfcs.common.cfimageeffects" method="init" returnvariable="effects">

<cfset lastcount = cookie.current_step>
<cfset nextcount = cookie.current_step + 1>
<cfset lastcount = "#lastcount#_">
<cfset nextcount = "#nextcount#_">

<cfset sepiaimage = effects.darkenImage(sourceImage)>
<cfset oldimage = '#request.basepath#images/temp/#cookie.imagefile#'>
<cfset newimage = "#request.basepath#images/temp/#replace(cookie.imagefile, lastcount, nextcount)#">

<cfcookie name = "imagefile" expires="NEVER" value="#replace(cookie.imagefile, lastcount, nextcount)#">
<cfset nextstep = cookie.current_step + 1>
<cfcookie name = "current_step" value="#nextstep#">
<cfset ImageWrite(sepiaImage, '#newimage#')>

<cfinclude template="../frm/edit.cfm">